<?php @session_start(); ?>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="keywords" content="">
        <meta name="author" content="">
        <title>Thankyou</title>
        <?php fnGetMeta(); ?>
        <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE; ?>css/payment.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE; ?>css/custom_product.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE; ?>css/sale_recepit.css" />
    </head>
    <body class="activateAppearAnimation header3" style="padding-top:0px;">
        <!-- Primary Page Layout 
                ================================================== --> 
        <!-- globalWrapper -->
        <div id="globalWrapper" class="localscroll">
            <?php fnGetHeader(); ?>

         <section class="inner_banner">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-6">
                            <ul id="navTrail">
                                <li><a href="<?php echo SITEURL;?>">Home</a></li>
                                <li id="navTrailLast">Thank You</li>
                            </ul>
                        </div>
                        <div class="col-sm-6 hidden-xs"></div>
                    </div>
                </div>
            </section>
            <section class="titles">

  </section>
   <section>
  <div class="container">
    <div class="row">
        <div class="success_thank">
            &nbsp;<h1>Success</h1>
            We have received your Payment. 
            Thank You.
            <a id="print_sales" href="<?php echo SITEURL; ?>/printrecepit/<?php echo $this->allOrderArray[0]['payment_ref_id']; ?>">
                <b>click here</b>
            </a> to print below receipt
        </div>
		
        
		
	<div id="white-wrapper">
	<div class="container">
		<div class="general-title">
		<h1>SALES RECEIPT</h1>
		</div>  <!-- end title -->

  
	  <div class="col-sm-3">
		<div class="col-lg-5">
			<p>
				BILL TO <br>
				<?php echo $this->sessionArray['user_prefix']." ".$this->sessionArray['user_firstname']." ".$this->sessionArray['user_lastname'] ?><br>
                                <?php echo $this->sessionArray['user_address'] ?><br>
				<?php echo $this->sessionArray['user_city'].", ".$this->sessionArray['user_state'].", ".$this->sessionArray['user_zipcode'] ?><br>
				<?php echo $this->sessionArray['user_country'];?> <br>
				
				</p>
			
		</div>   <!--  end left-slider -->	
	
		<div class="col-lg-6">
			<p>
				SALES NO. <?php  $saleid = str_replace("{-","",$this->sessionArray['qb_sale_docnumber']);
				echo str_replace("}","",$saleid);
				?> <br>
				DATE <?php  echo date('m/d/Y',strtotime($this->sessionArray['createDate']));?>
			</p>
		
		</div>   <!-- end right-slider -->

	  </div>
	</div>   <!-- end container -->
	<hr>
	
      
	<div class="contentTabs">
		<p>
		PMT METHOD<br>
            <?php 
            if($this->sessionArray['payment_gateway'] == 'paypal'):
                    echo 'Paypal';
                else:
                    
                    echo ucfirst($this->sessionArray['payment_method']);//'Credit Card';
                endif; ?>
              		</p>
	
	</div>   <!-- end contentTabs  -->
	
</div>
 
	<div id="grey-wrapper">
		<div class="container">
			<table>
				<tr class="row-in">
					<th>ACTIVITY</th>
					<th>DATE</th>
					<th>QTY</th>
					<th>RATE</th>
					<th>AMOUNT</th>
				</tr>
				<?php 
				$total_amount = '';
				foreach($this->allOrderArray as $key =>$value): 
						$total_amount += $value['or_price'];
				?>
				<tr>
					<td class="navbar"><?php echo $value['prd_name']. " ( ".$value['prd_code'] ." )" ?></td>
					<td><?php echo date('m/d/Y',strtotime($value['or_createdate'])); ?></td>
					<td><?php echo  $value['or_prd_qty']; ?></td>
					<td>$ <?php echo $value['or_prd_price']; ?></td>
					<td>$ <?php echo $value['or_price']; ?></td>
				</tr>
				<?php endforeach;?>
                                <?php if($value['pt_coupon_code'] != ''):?>
                                <tr>
					<td class="navbar"><?php echo "Discount Code - ".$value['pt_coupon_code'] ?></td>
					<td><?php echo date('m/d/Y',strtotime($value['or_createdate'])); ?></td>
					<td><?php echo  $value['pt_coupon_qty']; ?></td>
					<td> - $<?php echo $value['pt_coupon_price']; ?></td>
					<td> - $<?php echo $value['pt_coupon_qty'] * $value['pt_coupon_price']; ?></td>
				</tr>
                                <?php  endif;?>
			</table>
		</div>  <!-- end container -->
	</div>
	<div id="total_amount">
            <p>Total includes all applicable taxes.</p>
		<div class="left_label">Total</div>
		<div class="right_label">$ <?php  
                $final_Amt = $total_amount - ($value['pt_coupon_qty'] * $value['pt_coupon_price']);
                echo number_format($final_Amt,2);?></div>
	</div>
	<br/>
	</div>
	
  </div>
  
</div>
</section>



	



        
        <div id="contentBk" class="clearfix">
           <?php fnGetHmFooter(); ?>
    </body>
</html>